// var mongoose = require('mongoose');
// var mongoosePaginate = require('mongoose-paginate');

// var Schema =  mongoose.Schema;

// var ObjectId = Schema.ObjectId;

// var CommentSchema = new Schema({
// 	name:String,
// 	content:String,
// 	comment:String,
// 	cateid:ObjectId,
	
// 	date: { type: Date, default: Date.now }
// })

//CommentSchema.plugin(mongoosePaginate);

//module.exports = mongoose.model('Comment',CommentSchema,'comment');


const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const mongoosePaginate = require('mongoose-paginate');
const ObjectId = Schema.ObjectId;


// 定义一个普通的数据模型
var CommentSchema = new mongoose.Schema({    
    userId:ObjectId,
    content:String,
    newsId:ObjectId,
    cateId:ObjectId,    
    date:{type:Date,default: Date.now },
    
});
// 将数据模型应用分页插件
CommentSchema.plugin(mongoosePaginate);

module.exports = mongoose.model('comment', CommentSchema,'comment');

